<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>解决浮动的影响</title>
    <style>
        .outer{
            width: 500px;
            background-color: gray;
            border: 1px solid black;
            /* height: 122px;*/ /*第一种解决方案，但不完全 */
        }

        .box {
            width: 100px;
            height: 100px;
            background-color: skyblue;
            border: 1px solid black;
            margin: 10px;
        }
        .box1,.box2,.box3{
            float: left;
        }
/*         .box4{
            display: inline-block; /*使用行内块来解决
        } */
        .mofa{
            clear: left; /*消除左边所有浮动产生影响的兄弟*/
        }
        .outer::after{ /* 第5种解决方案 */
            content: '';
            display: block;
            clear: both;
        }
    </style>
</head>
<body>
    <div class="outer">
        <div class="box box1">1</div>
        <div class="box box2">2</div>
        <div class="box box3">3</div>
        <!-- <div class="mofa"></div> --><!-- 第4种解决方案：在最后补充一个空白块，无高无宽无内容来撑起父元素 -->
    </div>
    <div>Lorem ipsum dolor sit amet consectetur adipisicing elit. Eaque quas expedita, suscipit nulla architecto voluptates animi tenetur quidem iure laudantium laboriosam nobis accusamus culpa repudiandae aliquam reprehenderit debitis similique quibusdam?</div>
</body>
</html>